

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/2.jpg">
  <link rel="icon" type="image/png" href="/img/2.jpg">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="K">
  <meta name="keywords" content="">
  <title>gitlab远程仓库 - K</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/github-gist.min.css" />
    
  

  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.2.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>かい</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner intro-2" id="background" parallax=true
         style="background: url('/img/1.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container page-header text-center fade-in-up">
            <span class="h2" id="subtitle">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2020-03-14 13:19" pubdate>
        2020年3月14日 下午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.3k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      19
       分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto" id="post">
            <!-- SEO header -->
            <h1 style="display: none">gitlab远程仓库</h1>
            
            <div class="markdown-body" id="post-body">
              <h2 id="Gitlab"><a href="#Gitlab" class="headerlink" title="Gitlab"></a>Gitlab</h2><ul>
<li><p>概述<br>Gitlab 是一个用于仓库管理系统的开源项目，是代码管理工具<br><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/gitlablogo.jpg" srcset="/img/loading.gif"></p>
</li>
<li><p>服务组成</p>
<ul>
<li>nginx 静态服务器</li>
<li>gitlab-shell 用于处理git命令和修改authorized keys列表(ruby)</li>
<li>gitlab-workhorse 轻量级反向代理服务器，会处理一些大的http请求，比如上传，下载（push/pull）和git包下载，其他请求会反向代理到gitlab rails应用，及反向代理给后端的unicorn(托管软件)</li>
<li>logrotae 日志管理工具</li>
<li>postgresql 数据库工具</li>
<li>redis 缓存数据库工具</li>
<li>sidekiq 用于在后台执行队列任务</li>
<li>unicorn http服务器 gitlab rails应用托管在这里 有Ruby编写</li>
</ul>
</li>
</ul>
<ul>
<li>工作流程<br> <img src="https://images2017.cnblogs.com/blog/1075432/201711/1075432-20171115104741187-1623335004.png" srcset="/img/loading.gif" alt="图片来源：PhoenixTree(梧桐树)"></li>
</ul>
<ul>
<li>配置文件  <pre><code class="hljs awk"><span class="hljs-regexp">/opt/gi</span>tlab <span class="hljs-comment">## gitlab主目录</span>
<span class="hljs-regexp">/etc/gi</span>tlab <span class="hljs-comment">## 配置文件目录</span>
<span class="hljs-regexp">/var/</span>opt/gitlab <span class="hljs-comment">## 存放各个组件的目录</span>
<span class="hljs-regexp">/var/</span>log/gitlab <span class="hljs-comment">## 存放日志文件的目录</span></code></pre>

</li>
</ul>
<h2 id="Gitlab-安装"><a href="#Gitlab-安装" class="headerlink" title="Gitlab 安装"></a>Gitlab 安装</h2><ul>
<li><p>准备环境</p>
<table>
<thead>
<tr>
<th>linux主机</th>
<th>IP 192.168.100.200</th>
</tr>
</thead>
</table>
<ul>
<li>运行内存4G 两个核心 并且已经安装git</li>
<li>gitlab版本 <blockquote>
<p>gitlab-ce-12.3.0-ce.0.el7.x86_64</p>
</blockquote>
</li>
</ul>
<pre><code class="hljs css"><span class="hljs-selector-attr">[root@localhost ~]</span># <span class="hljs-selector-tag">rpm</span> <span class="hljs-selector-tag">-ivh</span> <span class="hljs-selector-tag">gitlab-ce-12</span><span class="hljs-selector-class">.3</span><span class="hljs-selector-class">.0-ce</span><span class="hljs-selector-class">.0</span><span class="hljs-selector-class">.el7</span><span class="hljs-selector-class">.x86_64</span><span class="hljs-selector-class">.rpm</span> # 直接<span class="hljs-selector-tag">rpm</span>安装，如果有依赖，就<span class="hljs-selector-tag">yum</span>安装
</code></pre></li>
<li><p>gitlab 命令</p>
<pre><code class="hljs sql">gitlab-ctl <span class="hljs-keyword">start</span>/<span class="hljs-keyword">stop</span> <span class="hljs-comment"># 开启/关闭gitlab</span>
gitlab-ctl <span class="hljs-keyword">start</span>/<span class="hljs-keyword">stop</span> 组件名 <span class="hljs-comment"># 开启/关闭某个组件</span>
gitlab-ctl tail <span class="hljs-comment"># 查看gitlab日志</span>
gitlab-ctl tail 组件名 <span class="hljs-comment"># 查看gitlab某组件日志</span>
gitlab-ctl reconfigure <span class="hljs-comment"># 重新编译 ,修改完配置文件后执行。</span>
gitlab-ctl <span class="hljs-keyword">status</span> <span class="hljs-comment"># 查看gitlab的状态</span></code></pre>
</li>
<li><p>基础配置和首次登录设置</p>
<pre><code class="hljs autoit">[root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># vim /etc/gitlab/gitlab.rb </span>
<span class="hljs-meta"># 修改</span>
 external_url <span class="hljs-string">&#x27;http://192.168.100.200&#x27;</span> <span class="hljs-meta"># 虚拟环境下写主机的ip就可以，如果是生产环境，就写主机的域名</span>
 wq <span class="hljs-meta"># 保存退出</span>
 [root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-ctl reconfigure # 重新编译</span>
 [root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-ctl start # 启动gitlab</span></code></pre>
<ul>
<li>浏览器访问linux主机ip，登录到gitlab web管理界面<blockquote>
<p><a target="_blank" rel="noopener" href="http://192.168.100.200/">http://192.168.100.200</a><br>如果登录进不了web界面，尝试放行80，8080端口</p>
</blockquote>
</li>
</ul>
<p><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/web%E7%95%8C%E9%9D%A2.png" srcset="/img/loading.gif"></p>
<p>设置密码 最少八位 默认用户为root<br><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/web%E7%95%8C%E9%9D%A22.png" srcset="/img/loading.gif"></p>
</li>
</ul>
<h2 id="Gitlab数据备份和恢复"><a href="#Gitlab数据备份和恢复" class="headerlink" title="Gitlab数据备份和恢复"></a>Gitlab数据备份和恢复</h2><ul>
<li>备份数据<pre><code class="hljs gradle">    [root@localhost ~]# gitlab-rake gitlab:backup:create # 创建备份
    [root@localhost ~]# ls <span class="hljs-regexp">/var/</span>opt<span class="hljs-regexp">/gitlab/</span>backups/
<span class="hljs-number">1584167831</span>_2020_03_14_12.<span class="hljs-number">3.0</span>_gitlab_backup.tar # <span class="hljs-regexp">/var/</span>opt<span class="hljs-regexp">/gitlab/</span>backups/ 备份数据的存放目录</code></pre></li>
<li>数据恢复<pre><code class="hljs autoit">[root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-ctl stop unicon # 停止托管功能</span>
[root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-ctl stop sidekiq # 停止消息队列功能</span>
<span class="hljs-meta"># 停止这两个组件的原因是防止数据紊乱</span>
[root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-rake gitlab:backup:restore BACKUP=1584167831_2020_03_14_12.3.0 # 恢复备份的数据</span>
<span class="hljs-meta"># 在恢复之前gitlab会清除所有的数据，然后再将备份的数据恢复</span>
<span class="hljs-meta"># 开启之前关闭的两个组件</span>
[root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-ctl start unicon </span>
[root<span class="hljs-symbol">@localhost</span> ~]<span class="hljs-meta"># gitlab-ctl start sidekiq </span></code></pre>

</li>
</ul>
<h2 id="管理员密码恢复"><a href="#管理员密码恢复" class="headerlink" title="管理员密码恢复"></a>管理员密码恢复</h2><ul>
<li>密码忘记时<pre><code class="hljs excel">[root@localhost ~]# gitlab-rails console # 进到gitlab终端
# --------------------------------------------------------------------------------
 GitL<span class="hljs-symbol">ab:</span>       <span class="hljs-number">12.3</span>.<span class="hljs-number">0</span> (<span class="hljs-number">7099</span>ecf77cb)
 GitLab She<span class="hljs-symbol">ll:</span> <span class="hljs-number">10.0</span>.<span class="hljs-number">0</span>
 PostgreS<span class="hljs-symbol">QL:</span>   <span class="hljs-number">10.9</span>
# --------------------------------------------------------------------------------
Loading production environment (Rails <span class="hljs-number">5.2</span>.<span class="hljs-number">3</span>)
irb(main)<span class="hljs-symbol">:001</span><span class="hljs-symbol">:0</span>&gt; user = User.where(<span class="hljs-symbol">id:1</span>).first # 切换到id是<span class="hljs-number">1</span>的root用户
=&gt; #&lt;User <span class="hljs-symbol">id:1</span> @root&gt;
irb(main)<span class="hljs-symbol">:002</span><span class="hljs-symbol">:0</span>&gt; user.password=&#x27;<span class="hljs-number">12345678</span>&#x27; # 强制修改密码为<span class="hljs-number">12345678</span>
=&gt; <span class="hljs-string">&quot;12345678&quot;</span>
irb(main)<span class="hljs-symbol">:003</span><span class="hljs-symbol">:0</span>&gt; user.save! # 保存
Enqueued ActionMail<span class="hljs-symbol">er:</span><span class="hljs-symbol">:De</span>liveryJob (Job <span class="hljs-symbol">ID:</span> <span class="hljs-number">6460</span>a86e-b0cf-<span class="hljs-number">4</span>ea1-<span class="hljs-number">994</span>f-bf4a67c5b8dc) to Sidekiq(mailers) with argumen<span class="hljs-symbol">ts:</span> <span class="hljs-string">&quot;DeviseMailer&quot;</span>, <span class="hljs-string">&quot;password_change&quot;</span>, <span class="hljs-string">&quot;deliver_now&quot;</span>, #&lt;Global<span class="hljs-symbol">ID:0</span>x00007f079c37fd20 @uri=#&lt;U<span class="hljs-symbol">RI:</span><span class="hljs-symbol">:GI</span>D g<span class="hljs-symbol">id:</span>//gitlab/User/<span class="hljs-number">1</span>&gt;&gt;
=&gt; <span class="hljs-built_in">true</span>
irb(main)<span class="hljs-symbol">:004</span><span class="hljs-symbol">:0</span>&gt; exit # 退出</code></pre>

</li>
</ul>
<h2 id="Gitlab-Web界面使用"><a href="#Gitlab-Web界面使用" class="headerlink" title="Gitlab Web界面使用"></a>Gitlab Web界面使用</h2><ul>
<li><p>创建用户<br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B71.png" srcset="/img/loading.gif"><br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B72.png" srcset="/img/loading.gif"><br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B73.png" srcset="/img/loading.gif"></p>
</li>
<li><p>创建组<br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%BB%841.png" srcset="/img/loading.gif"><br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%BB%842.png" srcset="/img/loading.gif"><br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%BB%843.png" srcset="/img/loading.gif"><br> <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E7%BB%844.png" srcset="/img/loading.gif"></p>
</li>
<li><p>创建项目<br>  <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE1.png" srcset="/img/loading.gif"><br>  <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE2.png" srcset="/img/loading.gif"><br>  <img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE3.png" srcset="/img/loading.gif"></p>
</li>
<li><p>往项目里添加文件</p>
<blockquote>
<p>和github差不多</p>
</blockquote>
<ul>
<li>在主机生成秘钥</li>
</ul>
<pre><code class="hljs gherkin">[root<span class="hljs-meta">@localhost</span> ~]<span class="hljs-comment"># ssh-keygen </span>
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory &#x27;/root/.ssh&#x27;.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:nErtz98sTZ5S7S/5puIxNp1gwh1CfKsGUXWcrDRWrkg root<span class="hljs-meta">@localhost.localdomain</span>
The key&#x27;s randomart image is:
+---[RSA 2048]----+
|<span class="hljs-string">         oo..+o. </span>|
|<span class="hljs-string">        ... =o+  </span>|
|<span class="hljs-string">         .E+.+.  </span>|
|<span class="hljs-string">       o.+ +oo   </span>|
|<span class="hljs-string">      . S.+.=  . </span>|
|<span class="hljs-string">     . o  oo oo..</span>|
|<span class="hljs-string">      . ..  ==o+ </span>|
|<span class="hljs-string">         o .+** o</span>|
|<span class="hljs-string">          ooo++=+</span>|
+----[SHA256]-----+
[root<span class="hljs-meta">@localhost</span> ~]<span class="hljs-comment"># cat /root/.ssh/id_rsa.pub </span>
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDakZr4ayqXb1+oIofBIk4GQUANLoPFlG9HEX5zGAXG/I30OI748Yu5ZrJFbaQadoDHpn0OlKfpvrbd5QjL9iCv4lhrbqp4jYgacCJEmK/Dns9TAgMzQ77wM9frR0WLHIVKT5WuQRYXn3zBiaK5Y4uMwV4ymFDgl16NyM/5OjIClixmCtWKQxNevM+NO0WrzCgZ0pLbjad/og1613VnUFuTf7F3W4A5ZRYbO14JvSzpMQpNC22/WLW7sIo8oyTGHKK3r8pUd2eo7gloZ+e7w3mZt1NdmGLd+pwE9b3beXmTDXXRnjxx/Gl6ST0YslgVBq0zC+4tKKqs/y7ZeUdChDSn root<span class="hljs-meta">@localhost.localdomain</span>
<span class="hljs-comment"># 把公钥复制到gitlab上</span>
</code></pre>
<p><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E6%B7%BB%E5%8A%A0%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B61.png" srcset="/img/loading.gif"><br><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E6%B7%BB%E5%8A%A0%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B62.png" srcset="/img/loading.gif"><br><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E6%B7%BB%E5%8A%A0%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B63.png" srcset="/img/loading.gif"><br><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E6%B7%BB%E5%8A%A0%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B64.png" srcset="/img/loading.gif"></p>
<p>在主机创建一个本地git仓库</p>
<pre><code class="hljs routeros">[root@localhost ~]# mkdir test # 创建本地仓库
[root@localhost ~]# cd test/ 
[root@localhost test]# git init # 初始化git仓库
初始化空的 Git 版本库于 /root/test/.git/
[root@localhost test]# git<span class="hljs-built_in"> config </span>--global user.email <span class="hljs-string">&quot;1248287831@qq.com&quot;</span> #给本地仓库指定一个邮箱，让gitlab知道是谁上传的
[root@localhost test]# git<span class="hljs-built_in"> config </span>--global user.name <span class="hljs-string">&quot;lmk&quot;</span> 指定一个名字
[root@localhost test]# git remote <span class="hljs-builtin-name">add</span> origin  git@192.168.100.200:hello/hello.git # 添加远程仓库
[root@localhost test]# echo lmk &gt; 1.txt # 创建文件
[root@localhost test]# git <span class="hljs-builtin-name">add</span> 1.txt # 添加到暂存区
[root@localhost test]# git commit -m <span class="hljs-string">&quot;first&quot;</span> # 提交到本地仓库
[master（根提交） 5c97cdf] first
1 file changed, 1 insertion(+)
create mode 100644 1.txt
[root@localhost test]# git push origin master # 上传到远程仓库
The authenticity of host <span class="hljs-string">&#x27;192.168.100.200 (192.168.100.200)&#x27;</span> can<span class="hljs-string">&#x27;t be established.</span>
<span class="hljs-string">ECDSA key fingerprint is SHA256:lctkx1T1bLPxzCCYpVDcD4P7SvdrTR5LfZQpTBpVYfs.</span>
<span class="hljs-string">ECDSA key fingerprint is MD5:75:83:99:b3:7a:01:15:4b:43:62:2a:6e:16:78:78:45.</span>
<span class="hljs-string">Are you sure you want to continue connecting (yes/no)? yes</span>
<span class="hljs-string">Warning: Permanently added &#x27;</span>192.168.100.200<span class="hljs-string">&#x27; (ECDSA) to the list of known hosts.</span>
<span class="hljs-string">Counting objects: 3, done.</span>
<span class="hljs-string">Writing objects: 100% (3/3), 200 bytes | 0 bytes/s, done.</span>
<span class="hljs-string">Total 3 (delta 0), reused 0 (delta 0)</span>
<span class="hljs-string">To git@192.168.100.200:hello/hello.git</span>
<span class="hljs-string">* [new branch]      master -&gt; master</span></code></pre>
<p>查看gitlab<br><img src="/images/gitlab%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/%E6%B7%BB%E5%8A%A0%E9%A1%B9%E7%9B%AE%E6%96%87%E4%BB%B65.png" srcset="/img/loading.gif"></p>
</li>
</ul>
<h2 id="小结"><a href="#小结" class="headerlink" title="小结"></a>小结</h2><ul>
<li>gitlab代码托管仓库和github非常相似 一般gitlab在公司都是存储私有项目的，gitlab存放开源的项目，不过也可存放私有项目</li>
</ul>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/%E5%BE%AE%E6%9C%8D%E5%8A%A1%E6%9E%B6%E6%9E%84/">微服务架构</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/Git/">Git</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">本博客所有文章是以学习为目的，如果有不对的地方可以一起交流沟通共同学习 邮箱:1248287831@qq.com！</p>
              
              
                <div class="post-prevnext row">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2020/03/15/tomcat-web%E5%BA%94%E7%94%A8/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">tomcat-web应用</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2020/03/10/Github%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93/">
                        <span class="hidden-mobile">Github远程仓库</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div id="tocbot"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://space.bilibili.com/39165374" target="_blank" rel="nofollow noopener"><span>LMK</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


  

  
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/lazyload.js" ></script>
  



  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/js/clipboard-use.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: '#post-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "gitlab远程仓库&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>



  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "hover",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    var path = "/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>















</body>
</html>
